import 'package:flutter/material.dart';

import 'package:get/get.dart';
import '../../../services/screebAdapter.dart';
import '../controllers/productContent_controller.dart';

class CartItemNum extends GetView {
  ProductContentController controller = Get.find();
  CartItemNum({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: ScreenAdapter.width(244),
      height: ScreenAdapter.height(60),
      decoration: BoxDecoration(
          border:
              Border.all(width: ScreenAdapter.width(2), color: Colors.black12)),
      child: Row(
        children: [
          Container(
            alignment: Alignment.center,
            width: ScreenAdapter.width(80),
            height: ScreenAdapter.height(60),
            child: TextButton(
                onPressed: () {
                  controller.decCount();
                },
                child: const Text('-')),
          ),
          Container(
            alignment: Alignment.center,
            width: ScreenAdapter.width(80),
            height: ScreenAdapter.height(60),
            child: Obx(() => Text('${controller.count}')),
          ),
          Container(
            alignment: Alignment.center,
            width: ScreenAdapter.width(80),
            height: ScreenAdapter.height(60),
            child: TextButton(
                onPressed: () {
                  controller.icenCount();
                },
                child: const Text('+')),
          ),
        ],
      ),
    );
  }
}
